// Default button
.k-button {
    .border-radius();
    border-color: @button-border-color;
    color: @button-text-color;
    background-color: @button-background-color;
    background-position: 50% 50%;
    .composite-background(@button-gradient);
    .box-shadow(@button-shadow);

    // Hover state
    &:hover,
    &.k-state-hover {
        color: @button-hover-text-color;
        border-color: @button-hover-border-color;
        background-color: @button-hover-background-color;
        .composite-background(@button-hover-gradient);
        .box-shadow(@button-hover-shadow);
    }

    // Focused state
    &:focus,
    &.k-state-focused {
        border-color: @button-focused-border-color;
        .box-shadow(@button-focused-shadow);
    }

    // Pressed state
    &:active,
    &.k-state-active {
        color: @button-active-text-color;
        background-color: @button-active-background;
        border-color: @button-active-border-color;
        .composite-background(@button-active-gradient);
        .box-shadow(@button-active-shadow);
    }
    &.k-state-active {
        &:hover {
            color: @primary-hover-text-color;
            border-color: @primary-hover-border-color;
            background-color: @primary-hover-background-color;
        }
    }

    // Focus active
    &:focus:active:not(.k-state-disabled):not([disabled]) {
        .box-shadow(@button-focused-active-shadow);
    }

    // Disabled state
    &[disabled],
    &[disabled]:hover,
    &[disabled]:focus,
    &[disabled]:active,
    &[disabled]:hover:active,
    .k-state-disabled &,
    .k-state-disabled &:hover,
    .k-state-disabled &:focus,
    .k-state-disabled &:active,
    .k-state-disabled &:active:active,
    &.k-state-disabled,
    &.k-state-disabled:hover,
    &.k-state-disabled:focus,
    &.k-state-disabled:active,
    &.k-state-disabled:hover:active {
        color: @disabled-text-color;
        border-color: @disabled-border-color;
        background-color: @disabled-background-color;
        .composite-background(@disabled-gradient);
        .box-shadow(none);
    }

}




//Primary buttons
.k-primary {
    color: @primary-text-color;
    border-color: @primary-border-color;
    background-color: @primary-background-color;
    .composite-background(@primary-gradient);
    .box-shadow(@primary-shadow);

    // Hover state
    &:hover,
    &.k-state-hover {
        color: @primary-hover-text-color;
        border-color: @primary-hover-border-color;
        background-color: @primary-hover-background-color;
        .composite-background(@primary-hover-gradient);
        .box-shadow(@primary-hover-shadow);
    }

    // Focused state
    &:focus,
    &.k-state-focused {
        border-color: @primary-focused-border-color;
        .box-shadow(@primary-focused-shadow);
    }

    // Pressed
    &:active,
    &.k-state-active {
        color: @primary-active-text-color;
        border-color: @primary-active-border-color;
        background-color: @primary-active-background-color;
        .composite-background(@primary-active-gradient);
        .box-shadow(@primary-active-shadow);
    }

    // Focus active
    &:focus:active:not(.k-state-disabled):not([disabled]) {
        .box-shadow(@primary-focused-active-shadow);
    }

    // Disabled
    &[disabled],
    &[disabled]:hover,
    &[disabled]:focus,
    &[disabled]:active,
    &[disabled]:hover:active,
    .k-state-disabled &,
    .k-state-disabled &:hover,
    .k-state-disabled &:focus,
    .k-state-disabled &:active,
    .k-state-disabled &:hover:active,
    &.k-state-disabled,
    &.k-state-disabled:hover,
    &.k-state-disabled:focus,
    &.k-state-disabled:active,
    &.k-state-disabled:hover:active {
        color: @primary-disabled-text-color;
        border-color: @primary-disabled-border-color;
        background-color: @primary-disabled-background-color;
        .composite-background(@primary-disabled-gradient);
        .box-shadow(none);
    }

}




// Button group
.k-button-group {

    // Normal button
    .k-button {
        .box-shadow(none);
    }

    // Focused state
    .k-button:focus,
    .k-button.k-state-focused,
    > input[type="radio"]:focus + .k-button,
    > input[type="checkbox"]:focus + .k-button {
        .box-shadow(@button-focused-shadow);
    }

    // Selected state
    .k-button:active,
    .k-button.k-state-active,
    > input[type="radio"]:checked + .k-button,
    > input[type="checkbox"]:checked + .k-button {
        color: @button-active-text-color;
        background-color: @button-active-background;
        border-color: @button-active-border-color;
        .composite-background(@selected-gradient);

        &:hover {
            color: @primary-hover-text-color;
            border-color: @primary-hover-border-color;
            background-color: @primary-hover-background-color;
        }
    }


    // Border-radius
    .k-button {
        .border-radius( 0 );
    }

    .k-group-start,
    .k-button:first-child {
        .border-left-radius();
    }
    .k-group-end,
    .k-button:last-child {
        .border-right-radius();
    }
    .k-group-start.k-group-end,
    .k-button:first-child:last-child {
        .border-radius();
    }

}